package com.grass.p019lv.game;

import android.text.InputFilter;
import android.text.Spanned;
import java.util.regex.Pattern;

/* renamed from: com.grass.lv.game.DecimalDigitsInputFilter */
public class DecimalDigitsInputFilter implements InputFilter {
    Pattern mPattern;

    public DecimalDigitsInputFilter(int i, int i2) {
        StringBuilder sb = new StringBuilder();
        sb.append("[0-9]{0,");
        sb.append(i - 1);
        sb.append("}+((\\.[0-9]{0,");
        sb.append(i2 - 1);
        sb.append("})?)||(\\.)?");
        this.mPattern = Pattern.compile(sb.toString());
    }

    public CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
        if (!this.mPattern.matcher(spanned).matches()) {
            return "";
        }
        return null;
    }
}
